import { Component } from "@xuekl/cli-core/enums"
import * as c from '@xuekl/cli-core/components'
import { BaseForm } from '@xuekl/cli-core/builder'
export default class Login extends BaseForm {
    element = {
        hideRequiredAsterisk: true
    }
    username = ''
    password = ''
    gender = ''

    clear(): void {
        this.resetFields()
        this.setForm(new Login(this.opts))
    }

    getUsername(): c.Input {
        return {
            type: Component.Input,
            label: '用户名',
            mode: 'login',
            required: true
        }
    }

    getPassword(): c.Input {
        return {
            type: Component.Input,
            label: '密码',
            mode: 'login',
            required: true,
            element: {
                type: 'password'
            }
        }
    }

    getGender() {
        return {
            type: 'url-select',
            label: '性别'
        }
    }
}